From: Ian Campbell Date: Tue, 13 Dec 2011 15:31:12 +0000 (+0000) Subject: libxl: Compile with -Wformat-nonliteral. X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=c3bf51381044d61bb94ad72613563da8e3cd67d3;p=xen.git libxl: Compile with -Wformat-nonliteral. At least one compiler (some Ubuntu version) uses this by default and it seems like a good idea anyway and the fixup required is trivial. One hunk is from a patch by Ian Jackson. Signed-off-by: Ian Jackson Signed-off-by: Ian Campbell Reported-by: Adda Rathbone Tested-by: Adda Rathbone Tested-by: Andrew Pounce Committed-by: Ian Jackson --- diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 70c9c1cfe9..1c95718a75 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -12,7 +12,7 @@ XLUMAJOR = 1.0 XLUMINOR = 0 CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \ - -Wno-declaration-after-statement + -Wno-declaration-after-statement -Wformat-nonliteral CFLAGS += -I. -fPIC ifeq ($(CONFIG_Linux),y) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 13e038b6bf..c214637c7e 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -459,8 +459,8 @@ static int store_libxl_entry(libxl__gc *gc, uint32_t domid, path = libxl__xs_libxl_path(gc, domid); path = libxl__sprintf(gc, "%s/dm-version", path); - return libxl__xs_write(gc, XBT_NULL, path, "%s", libxl__strdup(gc, - libxl_device_model_version_to_string(dm_info->device_model_version))); + return libxl__xs_write(gc, XBT_NULL, path, "%s", + libxl_device_model_version_to_string(dm_info->device_model_version)); } static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config, diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c index 5969ae32ce..f0f3d09d87 100644 --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -515,7 +515,7 @@ int libxl__devices_destroy(libxl__gc *gc, uint32_t domid, int force) for (j = 0; j < num_devs; j++) { path = libxl__sprintf(gc, "/local/domain/%d/device/%s/%s/backend", domid, kinds[i], devs[j]); - path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s", path)); + path = libxl__xs_read(gc, XBT_NULL, path); if (path && libxl__parse_backend_path(gc, path, &dev) == 0) { dev.domid = domid; dev.kind = kind;